/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package blogic;

import bentity.beRack;
import bentity.beUbicacion;
import dao.daoRack;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 *
 * @author cesar
 */
public class blRack {

    public int getIdRack(int numFila, int numRack) throws SQLException{
        return (new daoRack().getIdRack(numFila, numRack));
    }

    public int getIdRackByXY(int x, int y) throws SQLException{
        return (new daoRack().getIdRackByXY(x, y));
    }

    public int getIdRackxUbi(int idUbicacion) throws SQLException{
        return (new daoRack().getIdRackxUbi(idUbicacion));
    }

    public int actualizarRack(int numFila, int numRack, int idRack) throws SQLException{
        return (new daoRack().actualizarRack(numFila, numRack, idRack));
    }

     public ArrayList<beRack> obtenerRacks(int estado) throws SQLException{
        return (new daoRack().obtenerRacksActivos(estado));
    }

      public ArrayList<beRack> obtenerRacksConSecs() throws SQLException{
        return (new daoRack().obtenerRacksConSecs());
    }

    public ArrayList<Integer> getEstados() throws SQLException{
       return (new daoRack().getEstados());
    }

    public ArrayList<beRack> obtenerRacksXUbica(ArrayList<beUbicacion> ubicaciones) throws SQLException{

         return (new daoRack().obtenerRacksXUbica(ubicaciones));
    }

    public ArrayList<String> obtenerEstados() throws SQLException{
         return (new daoRack().obtenerEstados());

    }

    public int bloquear(int id, int estado) throws SQLException{
        return (new daoRack().bloquear(id,estado));

    }

    public int desbloquear(int id, int estado) throws SQLException{
        return (new daoRack().desbloquear(id,estado));

    }

    public beRack obtenerRack(int idRack) throws Exception{
        return(new daoRack().obtenerRack(idRack));
    }

    public boolean validarTabla( int estado,int est) throws SQLException{
        return(new daoRack().validarTabla(estado,est));
    }

    public int actualizarTipoProdRack(int idRack, int idtipprod) throws SQLException{
        return(new daoRack().actualizarTipoProdRack(idRack, idtipprod));
    }

    public ArrayList<beUbicacion> dameUbicacionesXRack(int idRack) throws SQLException{
       return (new daoRack().dameUbicacionesXRack(idRack));
    }
    public boolean validarUbiRack(ArrayList<beUbicacion> ubicaciones) throws SQLException{
       return (new daoRack().validarUbiRack(ubicaciones));
    }

    public ArrayList<beRack> obtenerRaksXIncidentes() throws SQLException{
        return (new daoRack().obtenerRaksXIncidencias());
    }

    public int eliminarIncidencias(int idRack) throws SQLException{
        return (new daoRack().eliminarIncidencias(idRack));
    }

}
